﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Forms;

namespace RiskMan.Views.Level
{
    /// <summary>
    /// Логика взаимодействия для SoundPanel.xaml
    /// </summary>
    public partial class SoundPanel : Window
    {
        public SoundPanel()
        {
            InitializeComponent();
        }

        private void Button_Path_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog tmp = new OpenFileDialog();
            tmp.Filter = "wav files (*.wav)|*.wav";
            if (tmp.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                txbxSoundOrder.Text = tmp.FileName;
            }
        }

        private void Button_Cancel_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog tmp = new OpenFileDialog();
            tmp.Filter = "wav files (*.wav)|*.wav";
            if (tmp.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                txbxOpenPoz.Text = tmp.FileName;
            }
        }

        private void button2_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog tmp = new OpenFileDialog();
            tmp.Filter = "wav files (*.wav)|*.wav";
            if (tmp.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                txbxClosePoz.Text = tmp.FileName;
            }
        }

        private void Button_Accept_Click(object sender, RoutedEventArgs e)
        {
            Properties.Settings.Default.SoundOrder = txbxSoundOrder.Text;
            Properties.Settings.Default.SoundOpenPoz = txbxOpenPoz.Text;
            Properties.Settings.Default.SoundClosePoz = txbxClosePoz.Text;

            Properties.Settings.Default.Save();
            this.Close();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            txbxSoundOrder.Text = Properties.Settings.Default.SoundOrder;
            txbxOpenPoz.Text = Properties.Settings.Default.SoundOpenPoz;
            txbxClosePoz.Text = Properties.Settings.Default.SoundClosePoz;
        }

 
    }
}
